<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/content/mytags.jsp"%>
<!DOCTYPE html>
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<title>组织机构</title>
		<t:resource types="jquery,lhgdialog,easyui" />
	</head>
	<body>
		<div id="organization-list-layout" class="easyui-layout" data-options="fit:true">
			<div data-options="region:'center',border:false">
				<ui:datagrid name="organizationList" idField="id" action="organization.do?datagrid" title="组织机构列表">
					<ui:column field="id" title="编码" sortable="false" hidden="true" />
					<ui:column field="orgCode" title="组织编码" sortable="false" query="true" />
					<ui:column field="orgName" title="组织名称" sortable="false" query="true" />
					<ui:column field="orgDepict" title="组织描述" sortable="false" />
					<ui:column field="opt" title="操作" align="center" />
					<ui:deleteOpt url="organization.do?delete&id={id}" message="确定要删除组织机构[{orgCode}][{orgName}]吗？" permiCode="system:organization:delete" title="删除组织机构" />
					<ui:funcOpt funname="setUsers({id},{orgCode},{orgName})" permiCode="system:usersinorg:view" title="查看用户" />
					<ui:toolbar iconCls="add" title="新增组织机构" permiCode="system:organization:save" url="organization.do?addorupdate" funname="add" />
					<ui:toolbar iconCls="edit" title="编辑组织机构" permiCode="system:organization:save" url="organization.do?addorupdate" funname="update" />
				</ui:datagrid>
			</div>
			<div data-options="region:'east',split:true,collapsed:true,border:false,onExpand : function(){li_east = 1;},onCollapse : function() {li_east = 0;}" style="width: 660px;">
				<div id="setup-container-panel" class="easyui-panel" title="权限设置" data-options="fit:true,border:true">
					
				</div>
			</div>
		</div>
		<script type="text/javascript">
			function setUsers(id, orgCode, orgName) {
		        var title = '角色[' + orgCode + '][' + orgName + ']:当前的用户列表';
		        if(li_east == 0 || $('#organization-list-layout').layout('panel','east').panel('options').title != title){
		            $('#organization-list-layout').layout('expand','east');
		        }
		        $('#setup-container-panel').css('padding', '1px').panel({ 'title': title, 'href' : 'organization.do?userList&orgId=' + id });
			}
		</script>
	</body>
</html>